﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;
using IncoolDicomViewerBase;
using xDataSet;

namespace IncoolReg
{
    static class Program
    {
        [DllImport("wininet")]
        //判断网络状况的方法,返回值true为连接，false为未连接  
        public extern static bool InternetGetConnectedState(out int conState, int reder);

        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            OfflineUtility.CheckPathComplete();
            G_xDataSetConfigInterface = new xDataSetConfigOnline();
            G_xDataSetConfigInterface.Appid = "1234567890";
            int i = 0;
#if DEBUG
            if (InternetGetConnectedState(out i, 0))
            {
                if (OfflineUtility.HasOfflineData())
                {
                    Application.Run(new ChooseForm());
                }
                else
                {
                    Application.Run(new OnlineForm());
                }
            }
            else
            {
                Application.Run(new OfflineForm());
            }
#else
            Application.Run(new OnlineForm());
#endif
        }

        public static xDataSetConfigInterface G_xDataSetConfigInterface;
    }


}